package 银行存取款;

import java.util.Objects;

public class Account {
    private String ID;
    private double balance;

    public Account(String ID, double balance) {
        this.ID = ID;
        this.balance = balance;
    }

    public Account() {
    }

    public String getID() {
        return ID;
    }

    public void setID(String ID) {
        this.ID = ID;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public void Deposits(double money) {
        //存款
        this.balance += money;
    }

    public void Withdrawals(double money){
        //取款
        //1.判断余额是否足够
        if(balance >= money)
            this.balance -= money;
        else
            System.out.println("余额不足！");
    }
}
